package com.jnkj.demo.controller;

import com.jnkj.demo.Dao.ClassesDao;
import com.jnkj.demo.pojo.Classess;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class Classes {
    @Autowired
    private ClassesDao classesDao;
    //1
    @RequestMapping("tjbj")
    @ResponseBody
    public String tjbj(){
       Classess classes= new Classess();
       classes.setSbanji("软件工程");
       classes.setBanzhuren("茂老师");
       classes.setKskc("嵌入式开发");
       classes.setKbrq("2022-05-22");
       classesDao.addClasses(classes);
       return "添加成功";
    }
    //4
    @RequestMapping("selecta4")
    @ResponseBody
    public String selecta4(){
        classesDao.select4();
        return "查询成功";
    }
    //15
        @RequestMapping("upd15")
    @ResponseBody
    public String upd15(){
     Classess classes=new Classess();
        classes.setSname("孙七");
    classesDao.updClasses(classes);
        return "修改成功";
    }
    //9
    @RequestMapping("selecta9")
    @ResponseBody
    public String selecta9(){
        classesDao.select9();
        return "查询成功";
    }
    //19
    @RequestMapping("upd19")
    @ResponseBody
    public String upd19(){
        Classess classes=new Classess();
        classes.setSbanji("外语3班");
        classesDao.updClasses19(classes);
        return "修改成功";
    }
    @RequestMapping("upd200")
    @ResponseBody
    public String upd200(){
        Classess classes=new Classess();
        classes.setSbanji("外语3班");
        classesDao.updClasses200(classes);
        return "修改成功";
    }
}
